<?php

 $hv = new HocVi();

$ds=$hv->ds();

?>

<div id="module">
	<h2><span>Danh sách</span></h2>
	<?php
	echo "<table>";
		echo "<thead>";
			echo "<tr id=\"tieude\">";
				echo "<th>STT</th>";
				echo "<th>Tên Học Vị</th>";
				echo "<th>Viết Tắt</th>";				
				echo "<th colspan=\"2\">Chức Năng</th>";
			echo "</tr>";
		echo "</thead>";
		$stt=1;
		if (count($ds)>0) {
			foreach ($ds as $key) {
				echo "<tr>";
					echo "<td id=\"stt\">".$stt."</td>";
					echo "<td>".$key->getTen()."</td>";
					echo "<td>".$key->getVietTat()."</td>";					
					echo "<td class=\"hinh\"><a href=\"index.php?action=delete&id=".$key->getMa()."\" tilte=\"Xóa\" onclick=\" return xoaCV('".$key->getTen()."');\"><img src=\"../../../images/hr.gif\" title=\"Xóa\" /></a></td>";
					echo "<td class=\"hinh\"><a href=\"index.php?action=edit&id=".$key->getMa()."\" tilte=\"Sửa\"><img src=\"../../../images/edit-icon.gif\" title=\"Sửa\" /></a></td>";
				echo "</tr>";
			$stt++;
			}
		}
		else
		{
			echo "<tr><td colspan=\"5\">Danh sách rỗng</td></tr>";
		}
	echo "<tr><td colspan=\"5\" id=\"btthem\"><a href=\"index.php?action=add\" title=\"Thêm mới\" >Thêm</a></td></tr>";
	echo "</table>";
	?>
</div>